﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FUSE
{
    public class Blackhole : FUSE.MassedComponent
    {
        private Rectangle blackholeSource = new Rectangle();
        private Texture2D spriteMap;

        public Blackhole() :base()
        {
            throw new NotImplementedException();
        }
           

        public Blackhole(int mass) 
            :base(mass)
        {
        }

        public override void Initialize()
        {
            base.Initialize();
        }


        public override void LoadContent(Texture2D spriteMap)
        {

            this.spriteMap = spriteMap;
            Texture2D sourceTexture = new Texture2D(spriteMap.GraphicsDevice, 60, 60);
            blackholeSource = new Rectangle(0, 0, 60, 60);

            base.LoadContent(sourceTexture);
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            blackholeSource.X += 60;
            
            if (blackholeSource.X >= spriteMap.Width)
                blackholeSource.X = 0;

            spriteBatch.Draw(this.spriteMap, base.RenderPosition, blackholeSource, Color.White);
        }
    }
}
